package se.olli.jonsered;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListView;

public class JonseredActivity extends Activity {
	private ListView list;
	private MainMenuAdapter adapter;
	private Intent memActivity, famActivity, hisActivity, aboutActivity, galleryActivity;
	public static final String FONT = "font", CHARACTER = "character";
	private final String[] menuVals = new String[] { "Familjen", "Bostaden", "Memory", "Historia",  
			 "Om Skattkammaren"};
	private final Integer[] menuIcons = {
            R.drawable.menu_dot, R.drawable.menu_dot,
            R.drawable.menu_dot,
            R.drawable.menu_dot, R.drawable.menu_dot};

	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);
		
		memActivity = new Intent(this, MemoryActivity.class);
		famActivity = new Intent(this, FamiljenActivity.class);
		hisActivity = new Intent(this, HistoriaActivity.class);
		aboutActivity = new Intent(this, AboutActivity.class);
		galleryActivity = new Intent(this, GalleryActivity.class);

		list = (ListView) findViewById(R.id.main_menu);
		adapter = new MainMenuAdapter(this, menuVals, menuIcons);
		list.setAdapter(adapter);
		list.setOnItemClickListener(new OnItemClickListener() {

			public void onItemClick(AdapterView<?> parent, View view, int position,
					long id) {
				switch(position) {
				case 0:
					startActivity(famActivity);
					break;
				case 1:
                    startActivity(galleryActivity);
					break;
				case 2:
					startActivity(memActivity);
					break;
				case 3:
					startActivity(hisActivity);
					break;
				case 4:
					startActivity(aboutActivity);
					break;
				default:
					break;
				}
			}
		});
	}
}
